﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Defender.Command.Animation
{

    public sealed class CosOscillationAnimation : AnimationBase<float>
    {
        //Fields
        public float Multiplier { get; set; }
        public float Range { get; set; }

        //ctor
        public CosOscillationAnimation(float range, float multiplier)
        {
            this.Range = range;
            this.Multiplier = MathHelper.Clamp(multiplier, 0 , 1);
        }

        //Methods
        public override void Step(GameTime time)
        {
            Value = (float)(Range * Math.Cos(Multiplier * time.TotalGameTime.TotalMilliseconds / 365.25f));
        }
    }
}
